<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       
    </style>
</head>

<body>
<div id="dd">

</div>
</body>

</html>
<script>
    window.onload = function () {
        var num = 10
        var myTimer = setInterval(function () {
            num--
            if(num<0){
                num=10
            }
            dd.innerHTML=num
        }, 1000)
    }
</script>